import { Table, Tag, Space } from 'antd';

const DataTable = () => {
  // 表格列配置
  const columns = [
    {
      title: '姓名',
      dataIndex: 'name',
      key: 'name',
    },
    {
      title: '年龄',
      dataIndex: 'age',
      key: 'age',
    },
    {
      title: '标签',
      key: 'tags',
      dataIndex: 'tags',
      render: tags => (
        <>
          {tags.map(tag => (
            <Tag color="blue" key={tag}>{tag}</Tag>
          ))}
        </>
      ),
    },
  ];

  // 表格数据
  const data = [
    { key: '1', name: '袁扶成', age: 25, tags: ['辣鸡'] },
    { key: '2', name: '李一凡', age: 26, tags: ['新人'] },
  ];

  return <Table columns={columns} dataSource={data} />;
};

export default DataTable;